package tec.stan.ling.topo.graph.figure;

import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.ImageFigure;
import org.eclipse.draw2d.StackLayout;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.swt.graphics.Image;

import tec.stan.ling.core.top.model.Node;
import tec.stan.ling.topo.ICons;
import tec.stan.ling.topo.TopoPlugin;

/**
 * 
 * 
 * @author Stan 张新潮
 * @since 2009-12-31
 */
public class NodeFigure extends Figure {

	private ImageFigure state;

	private ImageFigure node;

	private TextFigure name;

	private Node element;

	public NodeFigure(Node element) {
		this.element = element;
		Image image = TopoPlugin.getImage(ICons.ELEMENT_MAP);
		node = new ImageFigure(image);
		this.add(node);
		this.setBounds(new Rectangle(element.getX(), element.getY(), image
				.getBounds().width, image.getBounds().height));
		setLayoutManager(new StackLayout());
	}
}
